package com.itheima.set;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class Test02 {

    public static void main(String[] args) {
        Set<String> set= new TreeSet<>();

        set.add("abc");
        set.add("bcade");
        set.add("bcade");
        set.add("zeftg");
        set.add("yuihnhvc");
        set.add("yuihnhvc");
        set.add("wdgre");
        System.out.println(set.size());
        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
        System.out.println("-------------");
        for (String s : set) {
            System.out.println(s);
        }





    }
}
